## -------------------------------------------------- #
## BatistaPereiraBuenoNunesPavao_JoP_README
## -------------------------------------------------- #

 Date: 2021-09-03

 Authors: Batista Pereira, Bueno, Nunes, and Pavão*

 Title: Fake News, Fact Checking, and Partisanship: The Resilience of Rumors in the 2018 Brazilian Elections
 
Contact Information: 
   Frederico Batista Pereira <fbatist1@uncc.edu>
   Natália S. Bueno <natalia.bueno@emory.edu>
   Felipe Nunes <felipnunes@gmail.com>
   Nara Pavão <narapavao@gmail.com>* 
*corresponding author	 
   
	
 Copyright (c) 2021, under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
 For more information see: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
 All rights reserved. 

## -------------------------------------------------- #

This file describes the contents of the replication archive used to conduct the analyses in the main text and appendix. 


## -------------------------------------------------- #
## install Stata/R and necessary packages for analysis
## -------------------------------------------------- #

open the .R files using RStudio or any text or source code editor 

set the working directory to the folder containing the data files 

The set working directory command in Stata is cd "directory name"

To get the command eclplot in Stata type findit eclplot


the set working directory command in R is setwd()
	type ?setwd for help documentation 

to set the path type into R: 

setwd("PATH_NAME")

where PATH_NAME is the path to the main folder


install packages if necessary:

	packages <- c("stringr", "stringi", "tidyverse" "foreign", "stopwords", "lubridate", "scales",
			"readxl", "xtable", "Cairo",
			"ggplot2", "dplyr", "ggrepel",
			"metaplus", "rmeta", "mvmeta", "meta",
			"metafor", "foreign", "readstata13", 
			"dmetar", "zoo")

	install.packages(packages)

See file packages.html in Code folder with information on package versions and session info.

You should place the folders that contain this file and the additional folders it contains into the R working directory. 

The R working directory is available via the getwd() function in R.

The attached code makes use of the file structure. As long as the folders are in the R working directory the script will find these files and work properly. 

The last version of R and Mac OS-X are:

	R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
	Copyright (C) 2020 The R Foundation for Statistical Computing
	Platform: x86_64-apple-darwin15.6.0 (64-bit)

The used version of Stata and Mac OS-X are:
	
	Stata 13.1
	Copyright 1985-2013 StataCorp LP 
	Platform: x86-64-apple-sierra10.12.6 (64-bit)



## -------------------------------------------------- #
## computer recommendations
## -------------------------------------------------- #

All models were estimated on a MacBook Pro (Retina, 13-inch, Late 2012), running macOS Catalina (10.15.7).



## -------------------------------------------------- #
# file folder descriptions
## -------------------------------------------------- #
 
Codebooks.pdf --- Codebook describing all variables in the datasets used in the analysis of the manuscript and appendix


code ---- folder containing the following script files:

	AppendixA.R: R code for Figures A2, A3, A4, A5 and A6 in Appendix A
	Fig1-2-AppendixL.R: R code for Figures 1, 2, and L1 and L2 and Tables L1-L3 in Appendix L
	main_analysis.do: Stata code for Figures 3, 4, 5, 6 and Tables and Figures in Appendices B, C, D, G, H, I and J. 



Figures --- folder contains all figures as eps files

Tables --- folder contains all table outputs as tex files


Data --- folder containing several datasets with data used in the main analysis and in the appendix; see Codebooks.pdf for a description of the datasets
	survey: survey data and questionnaire (in Portuguese)
	meta: data from papers included in the meta-analysis
	gtrends: data from google trends
	fact_checking_data: data from fact-checking websites
	crowdtangle-news: aggregate data from crowdtangle


## -------------------------------------------------- #
# additional notes 
## -------------------------------------------------- #


Microdata from Crowdtangle cannot be shared, but our data can be re-created using the list ID we shared in our replication materials.
The full dataset of fact-checking websites is not shared because it is being used in other projects. However, the data necessary for creating our Tables and Figures is included in the replication materials


## -------------------------------------------------- #
## end of file
## -------------------------------------------------- #

